<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition  xmlns="http://www.w3.org/1999/xhtml"
				 xmlns:h="http://java.sun.com/jsf/html"
				 xmlns:p="http://primefaces.org/ui"
				 xmlns:f="http://java.sun.com/jsf/core"
				 xmlns:ui="http://java.sun.com/jsf/facelets"
				 xmlns:c="http://java.sun.com/jsp/jstl/core"
				 xmlns:ssa="http://java.sun.com/jsf/composite/partials"
				 template="/template.xhtml">
	<ui:define name="content">
		<div class="row">
			<div class="span3">
				<ssa:project_menu/>
			</div>

			<div class="span9">
				<h1>#{bundle['project.team']}</h1>
				<p>
					<h:form>

						<p:dataTable value="#{projectManager.currentProject.users.toArray()}" var="user" styleClass="table table-bordered table-striped">
							<p:column>
								<f:facet name="header">#{bundle['user.fullName']}</f:facet>  
								<h:outputText value="#{user.fullName}"/>  
							</p:column>
							<p:column>
								<f:facet name="header">#{bundle['user.nickName']}</f:facet>  
								<h:outputText value="#{user.nickname}"/>  
							</p:column>
							<p:column>
								<f:facet name="header">#{bundle['user.email']}</f:facet>  
								<h:outputText value="#{user.email}"/>  
							</p:column>
						</p:dataTable>
						<p:commandButton id="addButton" type="button" onclick="projectTeamAddDialog.show()" value="#{bundle['action.add.user']}" image="ui-icon-gate" styleClass="btn btn-success"/> 

						<p:dialog widgetVar="projectTeamAddDialog"  header="#{bundle['action.add.user']}" resizable="false" minWidth="344" styleClass="well" >
							email:&nbsp;&nbsp;
							<p:inputText value="#{projectManager.addUserDialogEmail}" style="display:inline-block"/> 
							&nbsp;&nbsp;
							<p:commandLink value="#{bundle['action.add']}" update="@form,:growl" actionListener="#{projectManager.addUserByEmail(projectManager.addUserDialogEmail)}" styleClass="btn" />
						</p:dialog>
					</h:form>
				</p>
			</div>
		</div>
	</ui:define>
</ui:composition>